package com.jeesite.modules.digitalize.constants;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum CompareEnum {

    VERSION(0, "版本对比"),
    MODEL(1, "模型对比");

    private final Integer code;
    private final String desc;

    CompareEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CompareEnum getByCode(Integer code) {
        if (code != null) {
            return Arrays.stream(CompareEnum.values()).filter(item -> item.code.equals(code)).findFirst().get();
        }
        return null;
    }
}